package com.Dao;

import java.util.Random;

/**
 * @author Lenovo
 * @date 2022/1/5
 */
public class Question {
    public  static int a=0;
    public  static int b=0;
    public  static char opt='\0';// + 或-
    public  static int expectAnswer;
    static Random random = new Random();
    
    public void newGame(){
        a = random.nextInt(91)+10;
        b = random.nextInt(91)+10;
        opt = random.nextInt(2)==0?'+':'-';
        if(opt=='+')
            expectAnswer = a+b;
        else
            expectAnswer = a-b;
    }

    public  static  int getA() {
        return a;
    }

    public  static int getB() {
        return b;
    }

    public  static  char getOpt() {
        return opt;
    }

    public  static  int getExpectAnswer() {
        return expectAnswer;
    }

    public String toString() {
        return a+" "+opt +" "+b;
    }
}
